package com.gem.growingtree.db;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBLink {
	public static Connection getConnection(){
		try {
			Class.forName("com.mysql.jdbc.Driver");
			String url="jdbc:mysql://localhost:3306/growingtree";
			String user="root";
			String pass="123456";
			Connection conn=DriverManager.getConnection(url,user,pass);
			if(conn!=null)
			{			System.out.println("======数据库连接成功======");
}
			return conn;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
